local InnerDataManagerFW = require("innerdata.InnerDataManagerFW")
local InnerDataDefine = require("innerdata.Define")
local Msg = require("core.Msg")
local Lang = require("common.Lang")
local Broadcast = require("broadcast.Broadcast")
local ActivityExcel = require("excel.Activity")
local DailyActConfig = ActivityExcel.dailyAct
local OpenServerActConfig = ActivityExcel.openServerAct
local WildBossConfig = ActivityExcel.wildboss
local ActRule = ActivityExcel.dailyActRule
local ActDefine = require("activity.Define")
local DailyActFW = require("activity.DailyActFW")
local OpenServerActFW = require("activity.OpenServerActFW")
local OperateActFW = require("activity.OperateActFW")
local ComplexSrvActFW = require("activity.ComplexSrvActFW")
local DateActFW = require("activity.DateActFW")
local WorldBossLogicW = require("worldboss.WorldBossLogicW")
local WildBossLogicW = require("wildboss.WildBossLogicW")
local MapExcel = require("excel.Map")
local ArmyRiotLogicW = require("activity.armyRiot.ArmyRiotLogicW")
local ActRuleConfig = ActivityExcel.dailyActRule
local ExcelMonster = require("excel.Monster")
local MiddleActivity  = require("middle.MiddleActivity")
local OperateActLogicW = require("activity.operate.OperateActLogicW")
local ComplexSrvActLogicW = require("activity.complex.ComplexSrvActLogicW")
local DateActLogicW = require("activity.date.DateActLogicW")
local QPoint = require("activity.operate.QPoint")
local MiddleFamilySign = require("middle.MiddleFamilySign")
local Human = require("core.Human")

function CG_ACTIVITY_DAILYACT_LIST(human, oMsg)
    if oMsg.type == 0 then
        local nMsg = Msg.gc.GC_ACTIVITY_DAILYACT_LIST
        nMsg.activitys[0] = 0
        for nType, v in pairs(DailyActFW.DailyActList) do
            if nType ~= ActDefine.ACT_TYPE_WORLDBOSS then
                for nActConfigID, nActList in pairs(v._configList) do
                    nMsg.activitys[0] = nMsg.activitys[0] + 1
                    local nMsgData = nMsg.activitys[nMsg.activitys[0]]
                    local nActConfigData = DailyActConfig[nActConfigID]
                    if nActConfigData then
                        nMsgData.actType = nActConfigData.actType
                        nMsgData.name = nActConfigData.name
                        nMsgData.icon = nActConfigData.icon
                        nMsgData.thumb = nActConfigData.thumb

                        nMsgData.actDetail[0] = 0
                        for actNum, actArgs in pairs(nActList) do
                            if actArgs.show == 1 then
                                nMsgData.actDetail[0] = nMsgData.actDetail[0] + 1
                                local nActDetail = nMsgData.actDetail[nMsgData.actDetail[0]]
                                wrapDailyActDetail(nActDetail, nActConfigID, actNum, actArgs)
                            end
                        end
                    end
                end
            end
        end
        Msg.send(nMsg, human.fd)
    elseif oMsg.type == 1 then
        local nMsg = Msg.gc.GC_ACTIVITY_WORLDBOSS_LIST
        nMsg.activitys[0] = 0
        for nType, v in pairs(DailyActFW.DailyActList) do
            if nType == ActDefine.ACT_TYPE_WORLDBOSS then
                for nActConfigID, nActList in pairs(v._configList) do
                    nMsg.activitys[0] = nMsg.activitys[0] + 1
                    local nMsgData = nMsg.activitys[nMsg.activitys[0]]
                    local nActConfigData = DailyActConfig[nActConfigID]
                    if nActConfigData then
                        nMsgData.actType = nActConfigData.actType
                        nMsgData.name = nActConfigData.name
                        nMsgData.icon = nActConfigData.icon
                        nMsgData.thumb = nActConfigData.thumb
                        
                        nMsgData.actDetail[0] = 0
                        for actNum, actArgs in pairs(nActList) do
                            nMsgData.actDetail[0] = nMsgData.actDetail[0] + 1
                            local nActDetail = nMsgData.actDetail[nMsgData.actDetail[0]]
                            wrapDailyActDetail(nActDetail, nActConfigID, actNum, actArgs)
                        end

                    end
                end
            end
        end
        Msg.send(nMsg, human.fd)
    elseif oMsg.type == 2 then
        local nMsg = Msg.gc.GC_ACTIVITY_WILDBOSS_LIST
        nMsg.activitys[0] = 0
        for nActConfigID, nActArgs in pairs(WildBossLogicW.WildBossList._configList) do
            nMsg.activitys[0] = nMsg.activitys[0] + 1
            local nMsgData = nMsg.activitys[nMsg.activitys[0]]
            local nActConfigData = WildBossConfig[nActConfigID]
            if nActConfigData then
                nMsgData.actType = nActConfigData.actType
                nMsgData.name = nActConfigData.name
                nMsgData.icon = nActConfigData.icon
                nMsgData.thumb = nActConfigData.thumb
                nMsgData.middle = 0

                nMsgData.actDetail[0] = 0
                nMsgData.actDetail[0] = nMsgData.actDetail[0] + 1
                local nActDetail = nMsgData.actDetail[nMsgData.actDetail[0]]
                wrapWildBossActDetail(nActDetail, nActConfigID, nActArgs)
            end
        end
        Msg.send(nMsg, human.fd)
    end
end

function CG_ACTIVITY_OPENSERVER_QUERT(human, oMsg)
    local nMsg = Msg.gc.GC_ACTIVITY_OPENSERVERACT_LIST
    nMsg.activitys[0] = 0
    local nType = oMsg.type
    for nActType, v in pairs(OpenServerActFW.OpenServerActList) do
        if nActType == nType then
            for nActConfigID, nActList in pairs(v._configList) do
                nMsg.activitys[0] = nMsg.activitys[0] + 1
                local nMsgData = nMsg.activitys[nMsg.activitys[0]]
                local nActConfigData = OpenServerActConfig[nActConfigID]
                if nActConfigData then
                    for actNum, actArgs in pairs(nActList) do
                        wrapOpenServerActDetail(nMsgData, nActConfigID, actNum, actArgs)
                    end
                end
            end
        end
    end
    Msg.send(nMsg, human.fd)
end

function wrapDailyActDetail(actDetail, actConfigID, actNum, actArgs)
    if not actDetail or not actConfigID or not actArgs then
        return
    end

    local nActBaseContent = actDetail.actBaseContent
    nActBaseContent.id = actArgs._configID 
    nActBaseContent.actNum = actNum
    nActBaseContent.status = DailyActFW.onGetActStatus(actArgs.type, actNum, actArgs.hour, actArgs.min)
    nActBaseContent.join = ActRule[actArgs.ruleid].join
    nActBaseContent.leftTime = DailyActFW.onGetLeftTime(actNum, actArgs) 
    local nStartTime = actArgs.hour * 60 + actArgs.min
    local nGap = ActRule[actArgs.ruleid].gap
    local nEndTime = nStartTime + nGap
    nActBaseContent.startTime = nStartTime
    nActBaseContent.endTime = nEndTime
    wrapActCondition(nActBaseContent.actCondition, DailyActFW.onGetActCondition(actArgs.ruleid))
    wrapActArgs(nActBaseContent.actArgs, DailyActFW.onGetActArgs(actArgs.ruleid))

    actDetail.actWorldBossData[0] = 0
    if actArgs.type == ActDefine.ACT_TYPE_WORLDBOSS then
        actDetail.actWorldBossData[0] = 1
        wrapWorldBossData(actDetail.actWorldBossData[actDetail.actWorldBossData[0]], actArgs)
    end
    actDetail.actWildBossData[0] = 0
end

function wrapWildBossActDetail(actDetail, actConfigID, actArgs)
    if not actDetail or not actConfigID or not actArgs then
        return
    end

    local nActBaseContent = actDetail.actBaseContent
    nActBaseContent.id = actConfigID 
    nActBaseContent.actNum = actConfigID 
    nActBaseContent.status = WildBossLogicW.onGetActStatus(actConfigID, actArgs)
    nActBaseContent.join = WildBossConfig[actConfigID].join
    nActBaseContent.leftTime = WildBossLogicW.onGetLeftTime(actConfigID, actArgs) 
    nActBaseContent.startTime = 0 
    nActBaseContent.endTime = 0 
    wrapActCondition(nActBaseContent.actCondition, WildBossLogicW.onGetActCondition(actConfigID))
    wrapActArgs(nActBaseContent.actArgs, WildBossLogicW.onGetActArgs(actConfigID))

    actDetail.actWorldBossData[0] = 0
    actDetail.actWildBossData[0] = 1
    wrapWildBossData(actDetail.actWildBossData[actDetail.actWildBossData[0]], actArgs)

end

function wrapActCondition(msgList, conditionList)
    if not conditionList then
        return
    end
    msgList[0] = 0
    for k, v in pairs(conditionList) do
        msgList[0] = msgList[0] + 1
        local nCondition = msgList[msgList[0]]
        nCondition.key = k 
        nCondition.value = v
    end
end

function wrapActArgs(msgList, argsList)
    if not argsList then
        return
    end
    msgList[0] = 0
    for k, v in pairs(argsList) do
        msgList[0] = msgList[0] + 1
        local nArg = msgList[msgList[0]]
        nArg.key = k 
        nArg.value = v 
    end
end

function wrapWorldBossData(msgData, actArgs)
    local nKillData = msgData.killdata
    local nResult = WorldBossLogicW.onGetLastHitUser(actArgs._configID)
    nKillData.lastHitUuid, nKillData.lastHitName = nResult and nResult.lastHitUuid or "", nResult and nResult.lastHitName or "" 
end

function wrapWildBossData(msgData, actArgs)
    local nKillData = msgData.killdata
    local nResult = WildBossLogicW.onGetLastHitUser(actArgs._configID)
    nKillData.lastHitUuid, nKillData.lastHitName = nResult and nResult.lastHitUuid or "", nResult and nResult.lastHitName or "" 
    local nMapID = WildBossLogicW.onGetActArgsValue(actArgs._configID, ActDefine.ACT_ARGS_MAPID)
    msgData.mapName = MapExcel.scene[nMapID].name
end

function onSend2ClientDailyActUpdate(actNum, op, actArgs)
    if not actNum or not actArgs then
        return
    end

    local nActConfigData = DailyActConfig[actArgs._configID]
    local nActRule = ActRule[actArgs.ruleid]
    if not nActConfigData or not nActRule then
        return
    end

    if nActConfigData.actType == ActDefine.ACT_TYPE_JZWAR_ACT then
        local nMsg = Msg.gc.GC_DAILYACT_UPDATE
        nMsg.op = op
        local nActData = nMsg.activity

        nActData.actType = nActConfigData.actType
        nActData.name = nActConfigData.name
        nActData.icon = nActConfigData.icon
        nActData.thumb = nActConfigData.thumb
        nActData.actDetail[0] = 1
        wrapDailyActDetail(nActData.actDetail[nActData.actDetail[0]], actArgs._configID, actNum, actArgs)
        for k, v in pairs(Human.onlineUuid) do
            if v.fd then
                if not MiddleFamilySign.isFamilyWaring(v.familyUuid) then
                    Msg.send(nMsg, v.fd)
                end
            end
        end
    else
        local nMsg = Msg.gc.GC_DAILYACT_UPDATE
        nMsg.op = op
        local nActData = nMsg.activity

        nActData.actType = nActConfigData.actType
        nActData.name = nActConfigData.name
        nActData.icon = nActConfigData.icon
        nActData.thumb = nActConfigData.thumb
        
        
        nActData.actDetail[0] = 1

        wrapDailyActDetail(nActData.actDetail[nActData.actDetail[0]], actArgs._configID, actNum, actArgs)
        Msg.sendAll(nMsg)
    end
end

function onSend2ClientWildBossActUpdate(actNum, op, actArgs)
    if not actNum or not actArgs then
        return
    end

    local nActConfigData = WildBossConfig[actArgs._configID]
    if not nActConfigData then
        return
    end

    local nMsg = Msg.gc.GC_DAILYACT_UPDATE
    nMsg.op = op
    local nActData = nMsg.activity

    nActData.actType = nActConfigData.actType
    nActData.name = nActConfigData.name
    nActData.icon = nActConfigData.icon
    nActData.thumb = nActConfigData.thumb
    nActData.middle = 0
    
    nActData.actDetail[0] = 1

    wrapWildBossActDetail(nActData.actDetail[nActData.actDetail[0]], actArgs._configID, actArgs)
    Msg.sendAll(nMsg)
end

function wrapOpenServerActDetail(actDetail, actConfigID, actNum, actArgs)
    if not actDetail or not actConfigID or not actNum or not actArgs then
        return
    end

    local nActConfigID = actArgs._configID
    local nActConfigData = OpenServerActConfig[nActConfigID]
    if nActConfigData then
        actDetail.id = nActConfigID 
        actDetail.actNum = actNum
        actDetail.status = OpenServerActFW.onGetActStatus(actArgs.type, actNum)
        actDetail.join = 0 
        actDetail.actType = nActConfigData.actType
        actDetail.desc = nActConfigData.desc1
        actDetail.leftTime = OpenServerActFW.onGetLeftTime(actNum, actArgs) 

        local nStartDateTime = actDetail.startDate
        nStartDateTime.year = actArgs.startDateTime.year
        nStartDateTime.month = actArgs.startDateTime.month
        nStartDateTime.day = actArgs.startDateTime.day
        nStartDateTime.hour = actArgs.startDateTime.hour
        nStartDateTime.min = actArgs.startDateTime.min
        nStartDateTime.sec = actArgs.startDateTime.sec

        local nEndDateTime = actDetail.endDate
        nEndDateTime.year = actArgs.endDateTime.year
        nEndDateTime.month = actArgs.endDateTime.month
        nEndDateTime.day = actArgs.endDateTime.day
        nEndDateTime.hour = actArgs.endDateTime.hour
        nEndDateTime.min = actArgs.endDateTime.min
        nEndDateTime.sec = actArgs.endDateTime.sec

        --wrapActCondition(actDetail.actCondition, DailyActFW.onGetActCondition(actArgs.ruleid))
        --wrapActArgs(actDetail.actArgs, DailyActFW.onGetActArgs(actArgs.ruleid))
    end
end

function wrapOperateActDetail(actDetail, actConfigID, actArgs, type, which)
    if not actDetail or not actConfigID or not actArgs then
        return
    end

    actDetail.actid = actConfigID 
    actDetail.type = type 
    actDetail.actname = ""
    actDetail.acticonid = actArgs.iconid or 0 
    actDetail.acteffectid = actArgs.effectid or 0 
    actDetail.actmoduletype = actArgs.modletype or 0
    actDetail.actmoduleid = actArgs.modleid or 0 
    actDetail.sort = actArgs.sort or 0
    local nStartDateTime = actDetail.startDate
    local nTempDateTime = os.date("*t", actArgs.startDateTime)
    nStartDateTime.year = nTempDateTime.year
    nStartDateTime.month = nTempDateTime.month
    nStartDateTime.day = nTempDateTime.day
    nStartDateTime.hour = nTempDateTime.hour
    nStartDateTime.min = nTempDateTime.min
    nStartDateTime.sec = nTempDateTime.sec

    local nEndDateTime = actDetail.endDate
    nTempDateTime = os.date("*t", actArgs.endDateTime)
    nEndDateTime.year = nTempDateTime.year
    nEndDateTime.month = nTempDateTime.month
    nEndDateTime.day = nTempDateTime.day
    nEndDateTime.hour = nTempDateTime.hour
    nEndDateTime.min = nTempDateTime.min
    nEndDateTime.sec = nTempDateTime.sec
    actDetail.status = ActDefine.ACT_STATE_READY
    actDetail.leftTime = 0
    actDetail.desc = ""
    if which == 1 then
        actDetail.status = OperateActFW.onGetActStatus(actConfigID, actArgs.startDateTime)
        actDetail.leftTime = OperateActFW.onGetLeftTime(actConfigID, actArgs, type)
        actDetail.desc = OperateActFW.onGetActDesc(actConfigID, actArgs.ruleid)
    elseif which == 2 then
        actDetail.status = ComplexSrvActFW.onGetActStatus(actConfigID, actArgs.startDateTime)
        actDetail.leftTime = ComplexSrvActFW.onGetLeftTime(actConfigID, actArgs, type)
        actDetail.desc = ComplexSrvActFW.onGetActDesc(actConfigID, actArgs.ruleid)
    elseif which == 3 then
        actDetail.status = DateActFW.onGetActStatus(actConfigID, actArgs.startDateTime)
        actDetail.leftTime = DateActFW.onGetLeftTime(actConfigID, actArgs, type)
        actDetail.desc = DateActFW.onGetActDesc(actConfigID, actArgs.ruleid)
    end
end

function onSend2ClientOpenServerActUpdate(actNum, op, actArgs)
    if not actNum or not actArgs then
        return
    end

    local nMsg = Msg.gc.GC_OPENSERVERACT_UPDATE
    nMsg.op = op
    local nActData = nMsg.activitys

    wrapOpenServerActDetail(nActData, actArgs._configID, actNum, actArgs)
    Msg.sendAll(nMsg)
end

function onSend2ClientOperateActUpdate(actConfigID, op, actArgs)
    if not actNum or not actArgs then
        return
    end

    local nMsg = Msg.gc.GC_OPERATEACT_UPDATE
    nMsg.op = op
    local nActData = nMsg.activitys

    wrapOperateActDetail(nActData, actConfigID, actArgs, 1, 1)
    Msg.sendAll(nMsg)
end

function onSend2ClientComplexSrvActUpdate(actConfigID, op, actArgs)
    if not actNum or not actArgs then
        return
    end

    local nMsg = Msg.gc.GC_COMPLEXSRVACT_UPDATE
    nMsg.op = op
    local nActData = nMsg.activitys

    wrapOperateActDetail(nActData, actConfigID, actArgs, 1, 2)
    Msg.sendAll(nMsg)
end

function onSend2ClientDateActUpdate(actConfigID, op, actArgs)
    if not actNum or not actArgs then
        return
    end

    local nMsg = Msg.gc.GC_DATEACT_UPDATE
    nMsg.op = op
    local nActData = nMsg.activitys

    wrapOperateActDetail(nActData, actConfigID, actArgs, 1, 3)
    Msg.sendAll(nMsg)
end

function onSendBroadcast(actType, actState, actArgs)
    if ActDefine.ACT_TYPE_SHUANGBEI == actType then
        if actState == ActDefine.ACT_STATE_RUNNING then
            Broadcast.sendBroadcast2World(Lang.GROSSIP + Lang.UP, Lang.DAILY_ACTIVITY_SHUANGBEI_OPEN)
        elseif actState == ActDefine.ACT_STATE_ENDED then
            Broadcast.sendBroadcast2World(Lang.GROSSIP + Lang.UP, Lang.DAILY_ACTIVITY_SHUANGBEI_CLOSE)
        end
    elseif ActDefine.ACT_TYPE_ARMY_RIOT == actType then
        if actState == ActDefine.ACT_STATE_BEFORESTART then
            Broadcast.sendBroadcast2World(Lang.GROSSIP + Lang.UP, Lang.DAILY_ACTIVITY_RIOT_BEFORE)
        elseif actState == ActDefine.ACT_STATE_RUNNING then
            Broadcast.sendBroadcast2World(Lang.GROSSIP + Lang.UP, Lang.DAILY_ACTIVITY_RIOT_OPEN)
        elseif actState == ActDefine.ACT_STATE_ENDED then
            Broadcast.sendBroadcast2World(Lang.GROSSIP + Lang.UP, Lang.DAILY_ACTIVITY_RIOT_CLOSE)
        end
    elseif ActDefine.ACT_TYPE_GMTX_ACT == actType then
        local nRulID = actArgs.ruleid
        local nActRule = ActRuleConfig[nRulID]
        if nActRule then
            local nArgData = nActRule.args
            local nCopyID = nArgData[ActDefine.ACT_ARGS_MONSTER_COPYID]
            local nMonsterID = nArgData[ActDefine.ACT_ARGS_MONSTERID]
            local nMonsterName = ExcelMonster.monster[nMonsterID].name
            if actState == ActDefine.ACT_STATE_RUNNING then
                Broadcast.sendBroadcast2World(Lang.GROSSIP + Lang.UP, string.format(Lang.DAILY_ACTIVITY_GMTX_OPEN, nMonsterName, nCopyID))
            end
        end
    elseif ActDefine.ACT_TYPE_DHFIGHT_ACT == actType then
        if actState == ActDefine.ACT_STATE_RUNNING then
            Broadcast.sendBroadcast2World(Lang.GROSSIP + Lang.UP, Lang.DAILY_ACTIVITY_DHFIGHT_OPEN)
        end
    end
end

function CG_OPERATEACT_QUERY(human, msg)
    local nActList = OperateActFW.onGetTodayActList()
    local nSendMsg = Msg.gc.GC_OPERATEACT_QUERY
    nSendMsg.actlist[0] = 0
    if nActList then
        for k, v in pairs(nActList) do
            nSendMsg.actlist[0] = nSendMsg.actlist[0] + 1
            local nData = nSendMsg.actlist[nSendMsg.actlist[0]]
            wrapOperateActDetail(nData, k, v._configList, 1, 1)
        end
    end

    nActList = OperateActFW.onGetTomorrowActList()
    if nActList then
        for k, v in pairs(nActList) do
            nSendMsg.actlist[0] = nSendMsg.actlist[0] + 1
            local nData = nSendMsg.actlist[nSendMsg.actlist[0]]
            wrapOperateActDetail(nData, k, v._configList, 2, 1)
        end
    end
    Msg.send(nSendMsg, human.fd)
end

function CG_COMPLEXSRVACT_QUERY(human, msg)
    local nActList = ComplexSrvActFW.onGetTodayActList()
    if nActList then
        local nSendMsg = Msg.gc.GC_COMPLEXSRVACT_QUERY
        nSendMsg.actlist[0] = 0
        for k, v in pairs(nActList) do
            nSendMsg.actlist[0] = nSendMsg.actlist[0] + 1
            local nData = nSendMsg.actlist[nSendMsg.actlist[0]]
            wrapOperateActDetail(nData, k, v._configList, 1, 2)
        end
        Msg.send(nSendMsg, human.fd)
    end
end

function CG_DATEACT_QUERY(human, msg)
    local nActTitleID, nActList = DateActFW.onGetTodayActList()
    if nActList then
        local nSendMsg = Msg.gc.GC_DATEACT_QUERY
        nSendMsg.titleid = nActTitleID
        nSendMsg.actlist[0] = 0
        for k, v in pairs(nActList) do
            nSendMsg.actlist[0] = nSendMsg.actlist[0] + 1
            local nData = nSendMsg.actlist[nSendMsg.actlist[0]]
            wrapOperateActDetail(nData, k, v._configList, 1, 3)
        end
        Msg.send(nSendMsg, human.fd)
    end
end

function CG_OPERATEACT_CHONGZHIRANK_QUERY(human, msg)
    OperateActLogicW.onGetChongzhiRankData(human, msg.type)
end

function CG_COMPLEXSRVACT_CHONGZHIRANK_QUERY(human, msg)
    ComplexSrvActLogicW.onGetChongzhiRankData(human)
end

function CG_COMPLEXSRVACT_HOLIDAYGIFT_QUERY(human, msg)
    ComplexSrvActLogicW.onGetHolidayGiftData(human)
end

function CG_COMPLEXSRVACT_HOLIDAYGIFT_REWARD(human, msg)
    ComplexSrvActLogicW.onGetHolidayGiftReward(human)
end

function CG_DATEACT_HOLIDAYGIFT_QUERY(human, msg)
    DateActLogicW.onGetHolidayGiftData(human)
end

function CG_DATEACT_HOLIDAYGIFT_REWARD(human, msg)
    DateActLogicW.onGetHolidayGiftReward(human)
end

function CG_DATEACT_CHONGZHIXBACKY_QUERY(human, msg)
    DateActLogicW.onGetChongzhiXBackYData(human)
end

function CG_DATEACT_CHONGZHIXBACKY_REWARD(human, msg)
    DateActLogicW.onGetChongzhiXBackYReward(human)
end

function L2WProcess(human, nType, nData)
    if nData.type == 1 then
        DailyActFW.onAddAct(nData.data.actNum, nData.data.startHour, nData.data.startMin, nData.data.ruleID, nData.data.status)
    elseif nData.type == 2 then
        DailyActFW.onInit(true)
        CG_ACTIVITY_DAILYACT_LIST(human, {type = 0})
    elseif nData.type == 3 then
        DailyActFW.onEndAct(nData.data.actNum)
    elseif nData.type == 4 then
        CG_ACTIVITY_DAILYACT_LIST(human, {type = 2})
    elseif nData.type == 5 then
        for k, v in pairs(DailyActConfig) do
            if v.actType == nData.data.actType then
                for nHour, nHourData in pairs(v.startTime) do
                    for nMin, nRuleID in pairs(nHourData) do
                        DailyActFW.onAddAct(k, nHour, nMin, nRuleID, ActDefine.ACT_STATE_RUNNING)
                        return
                    end
                end
            end
        end
    elseif nData.type == 6 then
        for k, v in pairs(DailyActConfig) do
            if v.actType == nData.data.actType then
                DailyActFW.onEndAct(k)
            end
        end
    end
end

function CG_OPEN_YUNYING_ACTIVITY_QPOINT(human, msg)
  QPoint.open(human, msg.id, msg.type)
end

InnerDataManagerFW.Register(InnerDataDefine.INNERDATA_TYPE_YUNYING_DRAW, OperateActLogicW.setRecord)
InnerDataManagerFW.Register(InnerDataDefine.INNERDATA_TYPE_DATE_DRAW, DateActLogicW.setRecord)
InnerDataManagerFW.Register(InnerDataDefine.INNERDATA_TYPE_DATE_RECORD, DateActLogicW.sendRecord)
InnerDataManagerFW.Register(InnerDataDefine.INNERDATA_TYPE_ACT, L2WProcess)
DailyActFW.onRegisterCallBack(ActDefine.ACT_TYPE_ARMY_RIOT, nil, ArmyRiotLogicW.onActivityStart, ArmyRiotLogicW.onActivityEnd, nil) --活动回调
